package com.example.demo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.domain.po.BookTypeEntity;
import com.example.demo.mapper.BookTypeMapper;
import com.example.demo.service.BookTypeService;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class BookTypeServiceImpl extends ServiceImpl<BookTypeMapper, BookTypeEntity> implements BookTypeService {
    @Override
    public int deleteBookType(BookTypeEntity bookTypeEntity){
        return this.getBaseMapper().deleteById(bookTypeEntity);
    }

    public List<BookTypeEntity> getBookTypes(){
        List<BookTypeEntity> bList = this.list();
        return bList;
    }

    public BookTypeEntity addBookType(BookTypeEntity bookTypeEntity){
        this.save(bookTypeEntity);
        return bookTypeEntity;
    }
}
